import 'package:flutter/material.dart';

import '../../config/public_color.dart';

/// FileName require_rich_text
///
/// @Author lax
/// @Date 2023/4/3
///
/// @Description

class RequireRichText extends RichText {
  RequireRichText({
    super.key,
    String? text,
    TextStyle? style,
    bool required = true,
  }) : super(
    text: TextSpan(
      children: [
        TextSpan(text: text ?? '', style: style ?? TextStyle(fontSize: 14, color: PublicColor.darkText)),
        TextSpan(
          text: required ? ' *' : '',
          style: const TextStyle(fontSize: 14, color: Colors.red),
        ),
      ],
    ),
  );
}
